﻿using Domain.Entitys;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configers
{
    public class JurisdictionConfigers : IEntityTypeConfiguration<Jurisdiction>
    {
        /// <summary>
        /// 权限表
        /// </summary>
        /// <param name="builder"></param>
        public void Configure(EntityTypeBuilder<Jurisdiction> builder)
        {
            
            builder.ToTable(nameof(Jurisdiction));
            builder.HasKey(j => j.JuriID);
            builder.Property(j => j.JurName).IsRequired(false).HasMaxLength(50);
            builder.Property(j => j.GroupID).IsRequired();
            builder.Property(j => j.JurAddress).IsRequired(false).HasMaxLength(100);
        }
    }
}
